// JavaScript Document
  var g_member = new Object();
  var url = "http://www.jeegoon.com/jeegoonsvc.php";  
  function SetMember()
  {
    g_member = new Object();
    if(!ValidateMemberInput())
    {
    
      var c = getObj("btn_9936"); 
      //c.innerHTML = "<img src=/img/loading.gif align=absmiddle /> <span class=tip_i>Requesting</span>";
      var intext = "<red>Invaild User Info.</red>";
          intext +="<div align='left' onclick='f_1ed7da889c349b5778103f0acabdf112_do();' class='btn_2_o'>";
          intext +="<div align='center' class='btn_2_i'>"
          intext +="<a onmousedown='f_1ed7da889c349b5778103f0acabdf112_do();'' onclick='f_1ed7da889c349b5778103f0acabdf112_do();'' href='#;'>Sign Up</a>"
          intext +="</div>";
          intext +="</div>";
      c.innerHTML = intext;
      return;
    }
    
    var pl = new SOAPClientParameters();
		var usr = new Object();
		usr.Name = document.getElementById('MemberName').value;
		usr.Password = document.getElementById('MemberPassword').value;
		usr.Email = document.getElementById('MemberEmail').value;
    pl.add("Member", usr);
		pl.add("Action",1);
    SOAPClient.invoke(url,"SetMember",pl,true,SetMember_CallBack);
		//getmaxno();
  }
	function SetMember_CallBack(r)
	{
		alert(r["ID"]+' is created.');
		    
    var c = getObj("btn_9936"); 
    var intext = "Welcome to jeegoon.com!";
    c.innerHTML = intext;
	}
	
  function GetMember(async)
  {
    var pl = new SOAPClientParameters();
    var usr = new Object();
    usr.Name =  document.getElementById('MemberName').value;
    
    pl.add("UserName", document.getElementById('MemberName').value);
    SOAPClient.invoke(url,"GetMemberByName",pl,async,GetMember_CallBack);
  }
  function GetMember_CallBack(r)
  {
    g_member.Name = r["Name"];
    g_member.Password = r["Password"];
    g_member.Email = r["Email"];
    //alert(r);
  }
	
	function ValidateMemberInput()
	{
		var usr = new Object();
		usr.Name = document.getElementById('MemberName').value||'';
		usr.Password = document.getElementById('MemberPassword').value||'';
		usr.Email = document.getElementById('MemberEmail').value||'';	
    
    if(usr.Name == '' || usr.Password=='' || usr.Email=='')
    {
      return false;
    }
    /*
    var url = "http://www.jeegoon.com/jeegoonsvc.php";
    var pl = new SOAPClientParameters();
		var usr = new Object();
		usr.Name = document.getElementById('MemberName').value;
		usr.Password = document.getElementById('MemberPassword').value;
		usr.Email = document.getElementById('MemberEmail').value;
		
    pl.add("UserName", document.getElementById('MemberName').value);
    SOAPClient.invoke(url,"GetMemberByName",pl,true,GetMember_CallBack);
    */
    GetMember(false);
    if (g_member!=null)
    {
      if(g_member.Name !=null)
        return false;
      return true;
    }
    if(document.getElementById('MemberPassword').value != document.getElementById('MemberPassword1').value)
    {
      return false;
    }
    return true;
  }
